package com.core.db.execute;

import java.sql.SQLException;

import com.core.db.require.Require;

/**
 * sql操作
 * 
 * @author 殷田
 *
 */
public interface SqlAction
{
	/**
	 * 查询操作
	 * 
	 * @param table
	 * @param cond
	 * @return
	 * @throws SQLException
	 */
	public Result query( Require require ) throws SQLException;

	/**
	 * 插入操作
	 * 
	 * @param table
	 * @param cond
	 * @return
	 * @throws SQLException
	 */
	public boolean insert( Require require ) throws SQLException;

	/**
	 * 删除操作
	 * 
	 * @param table
	 * @param cond
	 * @return
	 * @throws SQLException
	 */
	public boolean delect( Require require ) throws SQLException;

	/**
	 * 更新操作
	 * 
	 * @param table
	 * @param cond
	 * @return
	 * @throws SQLException
	 */
	public boolean update( Require require ) throws SQLException;

	/**
	 * 直接执行查询sql
	 * 
	 * @param sql
	 * @return
	 * @throws SQLException
	 */
	public Result rawQuery( String sql ) throws SQLException;

	/**
	 * 直接执行sql语句
	 * 
	 * @param sql
	 * @return
	 * @throws SQLException
	 */
	public boolean raw( String sql ) throws SQLException;

}
